
import java.io.File;
import java.util.HashSet;

import com.sun.corba.se.impl.orbutil.closure.Future;

import brzozowski.Brzozowski;
import helpers.AutomataOperations;
import helpers.FileOperations;
import helpers.HandleHashSet;
import helpers.RunWithTimeOut;
import helpers.Stopwatch;
import hopcroft.Hopcroft_Algorithm;
import moore.Moore_Algorithm;
import automaton.*;
import exceptions.NotDeterministInitalStateException;
import exceptions.NotDeterministTransitionException;
import exceptions.UnknownInitialStateException;
import exceptions.UnknownTerminalStateException;


public class Console_Test7 {
	public static void main(String[] args) throws UnknownInitialStateException, NotDeterministInitalStateException, NotDeterministTransitionException {
		
		File root = new File("data");
		System.out.println("Timeout: 3600s");
		for (File file : root.listFiles()) {
			String filePath = root.getPath() +"/"+file.getName();
			System.out.println("=========================== Read from file " + file.getName());
			DFA automata = FileOperations.readFile(filePath);
			
			Thread thread = new Thread(new RunWithTimeOut(automata, 0));
			thread.start();
			Thread thread2 = new Thread(new RunWithTimeOut(automata, 1));
			thread2.start();
			Thread thread3 = new Thread(new RunWithTimeOut(automata, 2));
			thread3.start();
			try {
				thread.join(3600000);
				thread2.join(3600000);
				thread3.join(3600000);
					System.out.println("Timeout!!!");
			} catch (InterruptedException e) {
				System.out.println("Timeout");
			}
			
		}
		
	}
}
